<template>
	<view>
		<view class="cd_good_area">
			<view class="cd_good_list">
				<view class="cd_good_item" v-for="item in list" :key="item.id" :data-id="item.id" @click="togoods">
					<image :src="item.list_pic_url" mode="widthFix" class="cd_goods_item_img"></image>
					<!-- <view class="cd_goods_item_name">{{ item.name }}</view> -->
					<view class="cd_goods_item_price">{{ item.retail_price | toPrice }}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'mylist',
	data() {
		return {};
	},
	props: {
		list: {
			type: Array,
			default: []
		}
	},
	methods: {
		togoods(e) {
			uni.navigateTo({
				// url: `/pages/goodsDetailLhx/goodsDetailLhx?id=${e.currentTarget.dataset.id}`
				url: `/pages/myDetail/myDetail?id=${e.currentTarget.dataset.id}`
			});
		}
	}
};
</script>

<style lang="scss">
.cd_good_area {
	background-color: #fff;
	padding-bottom: 30rpx;

	.cd_good_title {
	}

	.cd_good_list {
		display: grid;
		grid-template-columns: 1fr 1fr;

		// 高度
		// grid-auto-rows: ;
		// 间距
		// gap
		.cd_good_item {
			.cd_goods_item_img {
				width: 100%;
			}

			.cd_goods_item_name {
				font-size: 30rpx;
				text-align: center;
			}

			.cd_goods_item_price {
				font-size: 26rpx;
				color: var(--price-color);
				text-align: center;
				margin-top: 20rpx;
			}
		}
	}
}
</style>
